<?php


namespace app\admin\model;


use think\Model;

class AdminLoginLog extends Model
{

    protected $pk = 'id';

    public function getList($where, $listRows=10,$params=[]){

        return $this->where($where)->order('id desc')->paginate($listRows,false,['query'=>$params]);
    }

    // 记录登录退出日志
    public function writeLog($data){

        $data['create_time'] = time();
        return $this->insertGetId($data);

    }

    public function getLastLog($admin_id){

        return $this->where('admin_id','=',$admin_id)->order('id desc')->find();
    }


}